/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.tencent.mavenproject1;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.URL;
import java.util.Properties;

/**
 * @author HappyQin
 */
public class ProxyConfig {
 private String httpProxyEnabled;
 private String httpProxyHost;
 private String httpProxyPort;
 private String httpNonProxyHosts;
 private String httpProxyAuthNeeded;
 private String httpProxyUser;
 private String httpProxyPwsd;

 private String socksProxyEnabled;
 private String socksProxyHost;
 private String socksProxyPort;
 private String socksNonProxyHosts;
 private String socksProxyAuthNeeded;
 private String socksProxyUser;
 private String socksProxyPwsd;

 Properties prop = new Properties();

 /**
  * @return Returns the httpNonProxyHosts.
  */
 public String getHttpNonProxyHosts() {
  return prop.getProperty("http.nonProxyHosts");
 }
 /**
  * @return Returns the httpProxyAuthNeeded.
  */
 public String getHttpProxyAuthNeeded() {
  return prop.getProperty("http.proxyAuthNeeded");
 }
 /**
  * @return Returns the httpProxyEnabled.
  */
 public String getHttpProxyEnabled() {
  return prop.getProperty("http.proxyEnabled");
 }
 /**
  * @return Returns the httpProxyHost.
  */
 public String getHttpProxyHost() {
  return prop.getProperty("http.proxyHost");
 }
 /**
  * @return Returns the httpProxyPort.
  */
 public String getHttpProxyPort() {
  return prop.getProperty("http.proxyPort");
 }
 /**
  * @return Returns the httpProxyPwsd.
  */
 public String getHttpProxyPwsd() {
  return prop.getProperty("http.proxyPwsd");
 }
 /**
  * @return Returns the httpProxyUser.
  */
 public String getHttpProxyUser() {
  return prop.getProperty("http.proxyUser");
 }

 /**
  * @return Returns the socksNonProxyHosts.
  */
 public String getSocksNonProxyHosts() {
  return prop.getProperty("socks.nonProxyHosts");
 }
 /**
  * @return Returns the socksProxyAuthNeeded.
  */
 public String getSocksProxyAuthNeeded() {
  return prop.getProperty("socks.proxyAuthNeeded");
 }
 /**
  * @return Returns the socksProxyEnabled.
  */
 public String getSocksProxyEnabled() {
  return prop.getProperty("socks.proxyEnabled");
 }
 /**
  * @return Returns the socksProxyHost.
  */
 public String getSocksProxyHost() {
  return prop.getProperty("socks.proxyHost");
 }
 /**
  * @return Returns the socksProxyPort.
  */
 public String getSocksProxyPort() {
  return prop.getProperty("socks.proxyPort");
 }
 /**
  * @return Returns the socksProxyPwsd.
  */
 public String getSocksProxyPwsd() {
  return prop.getProperty("socks.proxyPwsd");
 }
 /**
  * @return Returns the socksProxyUser.
  */
 public String getSocksProxyUser() {
  return prop.getProperty("socks.proxyUser");
 }
 /**
  *  
  */
 public ProxyConfig() {
  init();
 }

 private void init() {
  prop = new Properties();

  FileInputStream fis = null;
  try {
   URL url = getClass().getClassLoader().getResource(
     "proxy.config");
   if (url != null) {
    fis = new FileInputStream(url.getFile());
   }
  } catch (FileNotFoundException e) {
   e.printStackTrace();
  }
  if (fis != null) {
   try {
    prop.load(fis);
   } catch (IOException e1) {
    e1.printStackTrace();
   }
  }
 }
}